package edu.nanyang.hibernate;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import edu.nanyang.domain.User;

public class LoginImpl extends HibernateDaoSupport implements Login {

	public User login(String username, String password, String login1) {
		
		List list = this.getHibernateTemplate().find(
				"from edu.nanyang.domain.User u where u.username='" + username
						+ "' and u.password='" + password + "' and u.login='"
						+ login1 + "'");
		if (list.size() > 0) {
			return (User)list.get(0);
		} else {           
			return null;
		}

	}

}
